#include <iostream>
#include<string>
using namespace std;

int Low_cost(int cost[], int n, int cur)
{
    if (cur >= n)
        return 0;
    if (cur == n - 1)
        return cost[cur];

    int tmp = cur;
    int min = cur + 1;
    if (cur != n - 2)
    {
        if (cost[min] > cost[cur + 2])
        {
            min++;
        }
    }
    return cost[tmp] + Low_cost(cost, n, min);
}
int main()
{
    int cost[] = { 2,5,20 };
    int n = sizeof(cost)/sizeof(cost[0]);
    cout << n << endl;
    int min = 0;
    if (cost[0] > cost[1])
    {
        min = 1;
    }
    int lowstcost = Low_cost(cost, n, min);
    cout << lowstcost << endl;
    return 0;
}